Tracking a position of a motorized window treatment

ABSTRACT

A motorized window treatment system is provided for moving a covering material (e.g., a shade fabric). The motorized window treatment system includes a motor drive circuit configured to generate signals that cause a motor to change a position of the covering material. A sensor circuit is provided to generate one or more sensor signals indicative of the position of the covering material. The motorized window treatment system further includes a control circuit coupled to the sensor circuit to receive the one or more sensor signals. The control circuit is configured to detect a power-down event when a supply voltage is equal to or less than a threshold value, and stores a power-down position and one or more power-down sensor states. The control circuit is configured to determine a present position based on the stored power-down position and the one or more power-down sensor states.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims the benefit of U.S. Provisional PatentApplication No. 62/711,923, filed Jun. 30, 2018, the entire disclosureof which is hereby incorporated by reference.

BACKGROUND

Motorized window treatments, such as motorized roller shades, mayinclude a covering material (e.g., a shade fabric) and a motor driveunit for controlling a motor that adjusts a position of the coveringmaterial (e.g., a position of a bottom edge of the covering material).The motor drive unit may monitor a present position of the coveringmaterial, for example using sensors. The motor drive unit may use thepresent position of the covering material to control the operation ofthe shade or covering material.

For example, the covering material may have certain limits set forsafety and aesthetic reasons. Those limits may correspond to afully-open position and/or a fully-closed position relative to thecoverage area, e.g., a window. The motor drive unit may use the presentposition to adjust covering material to a desired position (e.g., thefully-open position, the fully-closed position, or an intermediateposition between the fully-open position and the fully-closed position).The motor drive unit may also use the present position to a make surethat the covering material does not move beyond prescribed limits (e.g.,the fully-closed position or the fully-opened position). More generally,the motor drive unit is used to accurately achieve desired coverage. Inaddition, the present position may also be used to ensure that the edgesof associated covering materials are aligned for aesthetics. Having thewindow treatment operate outside desired limits or in an undesiredmanner may impact the reliability of the motor or drive circuitry andmay lead to a decrease in customer satisfaction.

SUMMARY

As disclosed herein, a motorized window treatment system may include oneor more sensors coupled to a motor to generate sensor states indicativeof a position of a movable component. Some conditions of operation maycause the determined present position of the moveable component to shiftin one direction or the other. For example, a critical event, such as apower loss event, may result in inaccurate sensor state detection, whichmay in turn result in inaccurate determination of the present position.Such inaccuracies may be caused by hysteresis in the generation of thestates (e.g., a high state versus a low state) of the signals producedby circuitry used to sense magnetic fields associated with rotations ofthe motor (e.g., a Hall-Effect sensor circuit). Further, if the motor isrotating during the power loss event (e.g., while one or more internalsupply voltages are decreasing from nominal magnitudes towards zerovolts), the problem may be further exacerbated. Thus, when the motorizedwindow treatment system is powered up again after the critical event,the control circuit may no longer have an accurate position of themovable component or motor. In this regard, the present disclosureprovides for example systems and methods for correcting suchinaccuracies due to critical events.

More specifically, a loss of power to a motor drive unit of themotorized window treatment system may cause inaccuracies in the presentposition determined by the motor drive unit. A loss of power may becaused by a utility power outage, a local power outage (e.g., inresponse to cycling of a circuit breaker), or a motor stall (which maybe caused if the covering material becomes stuck on a nearby objectwhile the motor is rotating). When the motor drive unit is powered upagain after the power loss event, the present sensor states detected maynot be consistent with the sensor states detected during the power loss(even if the motor did not move). This means that the last positionstored in the motorized window treatment system that was determinedbased on the sensor states detected during the power loss may notaccurately reflect the present position of the motor and thus thecovering material upon power-up (even if the motor did not move).Further, the problem may be exacerbated if the motor continued to rotateduring the power loss event.

Such position inaccuracies, even if slight, impact the normal operationof the motorized window treatment system. For example, in the case of apower loss event where the motor was not rotating (and thus the coveringmaterial was not moving), the sensor states of the magnetic sensorrecorded prior to or during the power loss event and the sensor statesonce power is restored may not match up, indicating a possible smalldifference (e.g., less than one rotation) between the recorded andpresent positions. During install or repair, where the motorized windowtreatment system power may be cycled multiple times, the potentialadditive effect of small inaccuracies in the system may subsequentlyhave more significant operational and aesthetic impact on the motorizedwindow treatment system.

Such impact may include, for example, the motor drive unit moving thecovering material beyond the limits set for aesthetic reasons, or movingthe covering material to an inaccurate position. For example, moving thecovering material too far up may cause the covering material to becaught in the roller tube, which may result in damage to the coveringmaterial and/or the motor drive unit. As another example, moving thecovering material too far down may cause excess covering material tocollect on the floor, which may be unpleasant. In yet another example,the covering material may not be able to reach a fully-open or afully-closed position. The aesthetic problem is exacerbated for amotorized window treatment having multiple covering materials controlledby multiple motor drive units, since the drifts in the sensor states maybe different for the multiple motor drive units, which may make itimpossible to align the multiple covering materials. Further, theproblem may be exacerbated over time, since multiple power loss eventsmay cause the drift to accumulate over time.

As disclosed herein, a motorized window treatment system may comprise acovering material, a motor drive circuit configured to generate signalsthat cause a motor to change a position of the covering material, asensor circuit configured to generate one or more sensor signals (e.g.,two sensor signals) indicative of the position of the covering material,and a control circuit coupled to sensor circuitry to receive the one ormore sensor signals. The control circuit may, at power-up, determine apresent sensor state for each of two sensor signals, determine apredicted sensor state for each of the sensor signals, compare thepredicted sensor state with the present sensor state for each of thesensor signals, and determine the present position of the coveringmaterial based on the comparison of the predicted sensor state and thepresent sensor state of each of the sensor signals.

The control circuit may also cause storage in a memory of a firstposition value of the covering material and one or more power-downsensor values based on a supply voltage of the treatment system beingequal to or less than a threshold value, and wherein the control circuitis further configured to calculate a second position value based on thefirst position value and the one or more power-down sensor values storedin the memory and to cause storage in the memory of the second positionvalue as a system position reset. The supply voltage may be one of avoltage supplied by an external power source to the system or by aninternal power source of the system. The control circuit may calculatethe second position based on the first position value, the one or morepower-down sensor values, and a final position value. The controlcircuit may calculate the second position based on the first positionvalue, the one or more power-down sensor values, a final position value,and one or more final sensor values. The control circuit may calculatethe second position based on an adjustment factor, the adjustment factoris determined based on a comparison of the one or more final sensorvalues and one or more present sensor values.

In aspects of the technology disclosed herein, the control circuit ofthe motorized window treatment system may be configured to detect apower loss or impending power loss event based on a supply voltagefalling below a predetermined low-voltage threshold. Upon detection ofthe power loss event, the control circuit may store a present positionas the power-down position and one or more present sensor states as thepower-down sensor states. The low-voltage threshold may be set such thatthe motorized window treatment system may make an early detection of thepower loss event, but without being overly sensitive to noise. Further,because the power-down position and the power-down sensor states wererecorded before the supply voltage dropped to an even more undesirablylow level (e.g., when the control circuit is no longer able to calculatepositions based on sensor states), the control circuit may use thepower-down position and the power-down sensor states to determine anaccurate present position of the movable component after power isrestored and the motorized window treatment system is again operational.

Upon power-up, the control circuit may determine the final position fromthe memory during the power loss event. By comparing the final positionto the power-down position, the control circuit may determine whetherthe motor had continued to move or rotate after the power-down positionwas stored. If the motor was not moving during the power loss event(e.g., the power-down position matches the final position stored in themotorized window treatment system), power-up sensor states (e.g., thepresent sensor states at power-up) may be expected to be equal to thepower-down sensor states. If the power-up sensor states detected atpower-up match these power-down sensor states, the control circuit mayconclude that the power-down sensor states detected are accurate,therefore the power-down position determined based on these power-downsensor states are also accurate. The control circuit may then set thepresent position as the power-down position.

If, however, the power-up sensor states detected at power-up do notmatch these power-down sensor states, further corrections or an errorlog may be made. For example, if the power-up sensor states do not matchthese power-down sensor states, an adjustment factor may be determinedbased on a comparison of the power-down sensor states and the power-upsensor states. The control circuit may then set the power-up position atpower-up based on the power-down position and the adjustment factor. Theadjustment factor may comprise change in position based on a comparisonbetween the power-down sensor states and the power-up sensor. In caseswhere an adjustment factor cannot be determined, the control circuit maylog an error.

If the motor had continued moving after the power-down position wasstored (e.g., the power-down position does not match the final positionstored in the motorized window treatment system), the control circuitmay determine that further calculations are needed. For example, thecontrol circuit may calculate predicted final sensor states for thefinal position based on the power-down position, the final position, andthe power-down sensor states. The control circuit may then determine thepower-up sensor states, and compare them to the predicted final sensorstates to determine whether the present position may be set as the finalposition, or if further adjustments need to be made. In this regard, ifthe predicted final sensor states and the power-up sensor states are thesame, the control circuit may conclude that the predicted final sensorstates are accurate, therefore the final position must also be accurate.The control circuit may then set the present position at power-up as thefinal position. If, however, the predicted final sensor states and thepower-up sensor states are different, the control circuit may makefurther corrections or log an error. For example, the corrections may bemade based on an adjustment factor as described above, except that theadjustment factor would be determined based on a comparison between thepredicted final sensor states (instead of power-down sensor states) andthe power-up sensor states, and the present position at power-up may beset based on the final position and the adjustment factor.

The present disclosure further provides a method for adjusting a presentposition of a covering material of a motorized window treatment. Themethod may comprise: determining, at power-up, a present sensor statefor each of two sensors; determining a predicted sensor state for eachof the sensors; comparing the predicted sensor state with the presentsensor state for each of the sensors; and determining the presentposition of the covering material based on the comparison of thepredicted sensor state and the present sensor state of each of thesensors.

The present disclosure further provides a method for detecting apower-down event based on a voltage falling below a predeterminedthreshold low voltage, storing a position based on detection of thepower-down event as the power-down position, and storing a sensor statebased on detection of the power-down event as the power-down positionfor each of one or more sensors. The method may further comprisedetermining a final position stored in the memory during the power-downevent, and determining a predicted final sensor state for each of theone or more sensors for the final position based on the power-downposition, the final position, and the one or more power-down sensorstates.

The method may further comprise comparing the final position with thepower-down position, and determine whether a motor was rotating during apower loss event (e.g., while an internal supply voltage is decreasingfrom a nominal magnitude towards zero volts). If it was determined thatthe motor was rotating during the power loss event, the predicted finalsensor state for each of the one or more sensors is determined based ona number of sensor edges and the one or more power-down sensor states.If it was determined that the motor was stopped before and during thepower loss event, the predicted final sensor state is set as thepower-down sensor state for each of the one or more sensors.

The method may further comprise determining, at power-up after thepower-down event, a present sensor state for each of the one or moresensors, and comparing the predicted final sensor state with the presentsensor state for each of the one or more sensors when the predictedfinal position is different from the power-down position. If thepredicted final sensor state is different from the present power-upsensor state for at least one of the one or more sensors, it isdetermined that an inaccuracy exists at power-up.

The method may further comprise determining that the predicted finalsensor state and the present power-up sensor state are not different forall of the one or more sensors, determining an adjustment factor basedon a difference between the predicted final sensor state and the presentsensor state for at least one of the one or more sensors, and setting apresent position based on the final position and the adjustment factor.The method may further comprise determining that the predicted finalsensor state and the present power-up sensor state are different foreach of the one or more sensors, logging an error, and setting a presentpower-up position as the final position. The method may further comprisedetermining that no error occurred at power-up when the predicted finalsensor state is same as the present power-up sensor state for each ofthe one or more sensors, and setting a present power-up position as thefinal position.

The technology described herein is advantageous in a number of ways. Forexample, the technology provides for an early detection of criticalevents. With this early detection, the technology is equipped to storedata points that can still be trusted, and use these trusted data pointsto determine an accurate position upon power-up. The technology isefficient because it does not require storing all the sensor signalsthroughout a critical event, which may require both an increased memorysize and an increased processing power. Further, if all the sensorsignals throughout a critical event are stored, it may be difficult todetermine which of these sensor signals can be trusted, and which cannotbe trusted. In summary, by accurately reconstructing the presentposition of the movable component after critical events, the technologymay avoid moving the component beyond limits set for aesthetic reasons,or moving the component to an inaccurate position.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an example of a motorized window treatment system.

FIG. 2 is a block diagram illustrating an example motor drive unit of amotorized window treatment system.

FIGS. 3A and 3B illustrate an example of a sensor system of a motordrive unit of a motorized window treatment system.

FIG. 4 illustrates example positions stored in a memory of a motor driveunit of a motorized window treatment system.

FIGS. 5A and 5B illustrate example sensor signals that may be generatedby a sensor system of a motor drive unit of a motorized window treatmentsystem.

FIGS. 6-8 are flowcharts of example procedures that may be executed by acontrol circuit of a motor drive unit of a motorized window treatment.

DETAILED DESCRIPTION

FIG. 1 is a simplified block diagram illustrating an example windowtreatment system 100 according to aspects of the disclosure. The windowtreatment system 100 may include one or more window shades, such aswindow shades 110, 120. The window shades 110, 120 may each include acovering material, e.g., a shade fabric, such as shade fabrics 112, 122.The shade fabrics 112, 122 may each be supported by a roller tube, suchas roller tubes 114 and 124. The shade fabrics 112, 122 may be each madeof a flexible material that may be rolled onto or off the respectiveroller tube 114, 124 to raise and lower the shade fabric. One or moremovements of the shade fabrics 112, 122, respectively. For example, themotor drive units 130 and 140 may be configured to move the shadefabrics 112 and 122 between a fully-open position P_(FULLY-OPEN) and afully-closed position P_(FULLY-CLOSED), for example, with respect to awindow. In this example, the motor drive units 130 and 140 arepositioned inside the roller tubes 114, 124.

The motor drive units 130 and 140 may be coupled to a communication link150 and may communicate (e.g., transmit and/or receive) signals acrossthe communication link 150. The communication link 150 may be any typeof wired or wireless communication link, such as a radio-frequencycommunication link or an infrared communication link. For example, themotor drive units 130 and 140 may send signals to and/or receive signalsfrom each other (e.g., and any other motor drive units and controldevices that are not shown) via the communication link 150. This way,the various motor drive units of the window treatment system 100 maycontrol the various window shades in a coordinated fashion, such asmaking sure that the shades all align at the bottom.

In another example, the motor drive units 130 and 140 may send signalsto and/or receive signals from one or more user interfaces, such as auser interface device 160, via the communication link 150. For example,the user interface device 160 may be a keypad (as shown), a touchscreen, or a voice user interface. A user may enter commands via theuser interface device 160, for example, such as “fully open shade,”“fully close shade,” “open shade 40%,” “close shade by 20 cm,” “openboth shade 110 and shade 120,” “open shade 110 and close shade 120,”etc. The user interface device 160 may also include one or more displaysthat provide feedback to the user. For example, the display may be ascreen showing a status of the user's command, a status of the windowshades 110 and 120, or prompts for further user commands. The userinterface device 160 may include one or more visual indicators that maybe illuminated by light-emitting diodes (LEDs) to indicate a status ofthe window shades 110 and 120.

While only two window shades 110, 120 (e.g., with two shade fabrics 112,122, two roller tubes 114, 124, and two motor drive units 130, 140), andone user interface 160 are shown in the window treatment system 100 ofFIG. 1, any number of window shades, shade fabrics, roller tubes, motordrive units, and user interfaces may be included in the window treatmentsystem 100. Further, while each of the window shades 110, 120 is shownhaving separate roller tubes 114 and 124 and separate motor drive units120, 130, it should be understood that in other examples two or moreroller tubes may be driven by a single motor drive unit.

FIG. 2 is a simplified block diagram illustrating an example motor driveunit 200 according to aspects of the disclosure. The motor drive unit200 may be implemented in any system for moving one or more componentsin a controlled manner. For example, the motor drive unit 200 may beimplemented as the motor drive unit 130 shown in FIG. 1 to move theshade fabric 112. The motor drive unit 200 may include a motor 210 formoving one or more components (e.g., rotating the roller tube to movethe shade fabric 112 shown in FIG. 1). For example, the motor 210 may becoupled to the roller tube 114 for controlling rotation of the rollertube 114. The motor 210 may be any type of motor, such as adirect-current (DC) motor, an alternating-current (AC) motor, apermanent magnet motor, a brushless motor, a stepper motor, etc.

The motor drive unit 200 may include a motor drive circuit 220 fordriving the motor 210. The motor drive circuit 220 may be any type ofdrive circuit, such as an H-bridge drive circuit. The motor drivecircuit 220 may generate signals for driving the motor 210. For example,the motor drive circuit 220 may generate a pulse-width modulated (PWM)signal V_(PWM), which may have a duty cycle and may be provided to themotor 210. Adjustment of the magnitude of the duty cycle of the PWMsignal V_(PWM) applied to the motor 210 may change the rotational speedof the motor 210, and adjustment of a polarity of the PWM signal V_(PWM)applied to the motor 210 may change the direction of rotation of themotor 210.

The motor drive unit 200 may receive an input voltage V_(IN) from anexternal power supply (not shown). The external power supply may be anytype of power supply, such as an alternating-current (AC) power supply,a direct-current (DC) power supply, a battery, a photovoltaic powersource (e.g., such as a solar cell), etc. The motor drive unit maycomprise a bus capacitor C_(BUS) across which a bus voltage V_(BUS) maybe produced. The motor drive unit 200 may further include a rectifiercircuit (not shown) and/or a power converter circuit (not shown) forreceiving the input voltage V_(IN) and generating the bus voltageV_(BUS) across the bus capacitor C_(BUS). The bus voltage V_(BUS) may besupplied to the motor drive circuit 220 for generating signals thatdrive the motor 210. The bus voltage V_(BUS) may also be supplied to apower supply 230, which may generate a supply voltage V_(CC) to powerthe circuitry of the motor drive unit 200.

The motor drive unit 200 may further include a control circuit 240 forcontrolling the motor drive circuit 220, which in turn drives the motor210. The control circuit 240 may be configured to generate variouscontrol signals for controlling the motor drive circuit 220. Forexample, the control signals may include a drive signal V_(DRV) thatcauses the motor drive circuit 220 to control the rotational speed ofthe motor 210. For instance, the drive signal V_(DRV) may be a PWMsignal, where rotational speed of the motor 210 is dependent upon a dutycycle of the PWM signal. As another example, the control signals mayinclude a direction signal V_(DIR) that causes the motor drive circuit220 to control the direction of rotation of the motor 210. In anotherexample, the control signals may include an enable signal V_(ENABLE) forenabling and/or disabling the motor drive circuit 220, which in turnenables and/or disables the motor 210. The control circuit 240 mayinclude one or more processors. The one or more processors may be anyconventional processors, such as a commercially available CPU.Alternatively, the one or more processors may be dedicated componentssuch as an application specific integrated circuit (ASIC), amicroprocessor, a programmable logic device (PLD), a microcontroller, afield-programmable gate array (FPGA), or any suitable processing deviceor control circuit.

The motor drive unit 200 may include a sensor circuit 250. The sensorcircuit 250 may include one or more sensors that generate sensor signalsV_(S1), V_(S2) in response to the movements (e.g., rotations) of themotor 210. The one or more sensors may be any type of magnetic sensor,such as a Hall effect sensor, MEMs sensors, magneto-diode, etc. Forexample, the sensor circuit 250 may include one Hall effect sensor thatgenerates a sensor signal, where the sensor signal may include varioussensor states. For instance, each change in the sensor state mayindicate that a rotational position of the motor 210 has changed by acertain amount. For another example, the sensor circuit 250 may includetwo or more Hall effect sensors that each generate a sensor signalincluding various sensor states. For instance, a change in the state ofany of the sensor signals V_(S1), V_(S2) generated by the sensors mayindicate that the rotational position of the motor 210 has changed by acertain amount, and the states of the sensors signals V_(S1), V_(S2) forthe various sensors may collectively indicate the direction of rotationof the motor 210. The sensor circuit 250 may use hysteresis whengenerating the sensor signals V_(S1), V_(S2) and determining the stateof each sensor signal (e.g., a low state or a high state) as will bedescribed in greater detail below with reference to FIG. 3B.

FIG. 3A is a pictorial diagram illustrating an example sensor system 300according to aspects of the disclosure. The sensor system 300 may beimplemented in any motor drive unit for moving one or more components.For example, the sensor system 300 may be implemented as part of thesensor circuit 250 of the motor drive unit 200 shown in FIG. 2. Thesensor system 300 may be implemented to monitor movements of the one ormore components driven by the motor drive unit 200. For example, thesensor system 300 may be implemented to monitor rotations of a motor(e.g., the motor 210) to track the position of the shade fabric 112shown in FIG. 1, as well as the direction of rotation of the motor 210(e.g., whether the shade fabric 112 is being rolled upwards ordownwards).

The sensor system 300 may include a magnet 310, which may be securedonto the motor, for example onto a shaft 340 of the motor 210, such thatthe magnet 310 rotates with the shaft 340 as the motor 210 rotates. Forexample, a counterclockwise rotation (as shown) may correspond to adirection of rotation of the motor 210 that drives the shade fabric 112in an upwards direction (opening the shade), and a clockwise rotationmay correspond to a direction of rotation of the motor 210 that drivesthe shade fabric 112 in a downwards direction (closing the shade). Themagnet 310 may be any type of magnet, such as a circular magnet havingalternating north pole (e.g., positive pole) and south pole (e.g.,negative pole) regions. The magnet 310 may have any number of positivepoles and corresponding negative poles. For example, the magnet 310 mayhave two positive poles 312, 314 and two negative poles 316, 318 asshown in FIG. 3A.

The sensor system 300 may include two sensors: a first sensor 320 and asecond sensor 330. The first and second sensors 320, 330 may bepositioned along a periphery of the magnet 310 and separated from eachother by an angle, for example, by 45 degrees as shown. The first andsecond sensors 320, 330 may be magnetic sensors (e.g., Hall effectsensors) that may detect changes in magnetic flux density of magneticfields produced by the magnet 310 as the magnet 310 rotates with theshaft 340 of the motor 210. For example, each of the first and secondsensors 320, 330 may detect the two positive poles 312, 314 and the twonegative poles 316, 318 as the magnet 310 completes a full rotation.Alternatively, the first and second sensor 320, 330 may be locatedadjacent to each other, but may be oriented to detect magnetic fieldsthat are 45 degrees apart from each other. In addition, the first andsecond sensor 320, 330 may be positioned and/or oriented to detectmagnetic fields that are a difference amount apart from each other, suchas, for example, 90 degrees apart from each other.

FIG. 3B shows example sensor signals produced by the sensor system 300.The first and second sensors 320, 330 are configured to generate firstand second sensor signals 322, 332, respectively, for example usinghysteresis. The first and second sensors 320, 330 may each drive therespective sensor signal 322, 332 high towards the supply voltage V_(CC)to generate a high state (such as a logic 1) when the magnitude of arespective magnetic flux density B₁, B₂ at the respective sensor risesabove a high magnetic field threshold TH_(high). The first and secondsensors 320, 330 may each drive the respective sensor signal 322, 332low towards circuit common to generate a low state (such as a logic 0)when the magnitude of the respective magnetic flux density B₁, B₂ dropsbelow a low magnetic field threshold TH_(low). For example, as themagnet 310 rotates such that one of the positive poles 312, 314 is closeto the first sensor 320, the first sensor signal 322 may transition fromthe low state to the high state, thereby creating a rising edge 324 inthe first sensor signal 322. Likewise, as the magnet 310 rotates suchthat one of the negative poles 316, 318 is close to the first sensor320, the first sensor signal 322 may transition from the high state tothe low state, thereby creating a falling edge 326 in the first sensorsignal 322. Thus, during a full rotation of the magnet 310 (e.g., duringa period T shown in FIG. 3B), each of the first and sensor signals 322,332 may have four sensor edges (e.g., two rising edges and two fallingedges).

The relative spacing between the first and second sensor signals 322,332 may indicate the direction of rotation of the motor 210. Forexample, when the motor 210 is rotating in a counterclockwise directionof the shaft 340, the second sensor signal 332 may lag behind the firstsensor signal 322 by approximately 45 degrees (e.g., as shown in FIG.3B). For another example, when the motor 210 is rotating in a clockwisedirection of the shaft 340, the second sensor signal 332 may lead thefirst sensor signal 322 by approximately 45 degrees. The period T of thefirst and sensor signals 322, 332 may be a function of the rotationalspeed of the motor 210. The first and second sensor signals 322, 332 maybe sent as trains of pulses to the control circuit 240, for example foranalyses.

Although FIGS. 3A and 3B show the example sensor system 300 having twosensors 320, 330 and the magnet 310 with two positive poles 312, 314,and two negative poles 316, 318, any number of sensors may be includedwith a magnet having any number of north-south pole pairs. In thatregard, each sensor would generate a number of sensor edges equal to thenumber of poles of the magnet 310 during one full rotation of the magnet310. In examples where the sensor system 300 includes multiple sensors,the sensors may be spaced such that their relative spacings indicate therotation direction of the magnet. In examples where the sensor system300 includes only one sensor, the sensor signal itself would notindicate the direction of rotation of the magnet 310, but may bedetermined otherwise, for example from the direction signal V_(DIR) ofthe control circuit 240 or the PWM signal V_(PWM) of the motor drivecircuit 220.

Referring back to FIG. 2, the control circuit 240 may be configured todetermine the rotational position and/or the direction of rotation ofthe motor 210 based on the sensor signals V_(S1), V_(S2) generated bythe sensor circuit 250. For example, the control circuit 240 maydetermine that, based on the sensor signals V_(S1), V_(S2), the motor210 has rotated a certain amount in a particular direction. Based on therotational position and direction of rotation of the motor 210, thecontrol circuit 240 may be further configured to determine a presentposition P_(PRES) of the one or more components configured to be movedby the motor 210. For example, if the motor drive unit 200 isimplemented in the window treatment system 100 in FIG. 1, the controlcircuit 240 may be configured to determine, based on the sensor signalsV_(S1), V_(S2) indicating that the motor 210 has rotated a certainamount in a particular rotational direction, that the shade fabric 112has moved a certain distance in a particular linear direction. Thecontrol circuit 240 may be configured to update the present positionP_(PRES) of shade fabric in response to detecting edges of the sensorsignals V_(S1), V_(S2) (e.g., the present position P_(PRES) may becharacterized by a number of sensor edges).

The values for the fully-open position P_(FULLY-OPEN) and thefully-closed position P_(FULLY-CLOSED) may be set equal to the presentposition P_(PRES) when the shade fabric is at the desired fully-open andfully-closed limits, respectively. For instance, the values for thefully-open position P_(FULLY-OPEN) and the fully-closed positionP_(FULLY-CLOSED) may be set or reset during setup and configuration ofthe motor drive unit 200 and/or the window treatment system 100. Thedifference between the values for the fully-open position P_(FULLY-OPEN)and the fully-closed position P_(FULLY-CLOSED) may be approximatelyequal to the number of edges of the sensor signals V_(S1), V_(S2)between the fully-open position P_(FULLY-OPEN) and the fully-closedposition P_(FULLY-CLOSED).

The control circuit 240 may be configured to receive the sensor signalsV_(S1), V_(S2) from the sensor circuit 250 and periodically update thepresent position P_(PRES) of the fabric 112. For example, the controlcircuit 240 may increment or decrement the present position P_(PRES)each time that the control circuit 240 detects a change in one or moresensor states (e.g., rising or falling sensor edge). For anotherexample, the control circuit 240 may increment or decrement the presentposition P_(PRES) each time the motor 210 completes a full rotation.

The control circuit 240 may be configured to save data to a memory 260of the motor drive unit 200. For example, if the motor drive unit 200 isimplemented in the window treatment system 100 in FIG. 1, the controlcircuit 240 may be configured to store the present position P_(PRES) ofthe shade fabric 112 to the memory 260. The control circuit 240 mayperiodically update the present position P_(PRES) of the shade fabric112 stored in the memory 260 by overwriting the previous presentposition in a memory location, or by storing the present position indifferent memory locations. The control circuit 240 may be furtherconfigured to store the sensor states to the memory 260. To save memoryspace and time required to store data in the memory 260, the controlcircuit 240 may be configured not to save sensor states to the memory260, but only the present positions determined based on the sensorsignals. The control circuit 240 may further be configured to store tothe memory 260 various threshold values, such as a low-voltage thresholdvalue indicating a power loss event, the fully-open position value ofthe shade fabric 112, and predetermined fully-closed position value ofthe shade fabric 112. One example position table implemented in thememory 260 is described in detail below with respect to FIG. 4.

FIG. 4 is a pictorial diagram illustrating an example position table 400in a memory of a motorized window treatment. The position table 400 maybe implemented in any motor drive unit for moving a component. Forexample, the position table 400 may be implemented as part of the memory260 of the motor drive unit 200 shown in FIG. 2. The position table 400may be implemented to store positions of the one or more componentsdriven by the motor drive unit 200. For example, the position table 400may be implemented to store positions of the shade fabric 112 shown inFIG. 1.

Each row of the table 400 in this example may represent a memorylocation. For example, as shown in FIG. 4, position value 8000 is storedin memory location 1, position value 8001 is stored in memory location2, and position value 8522 is stored in memory location 7, etc. Eachtime a position value is stored in the position table 400, a memorycounter may be incremented and stored along with the correspondingposition value in the same memory location. In this example, each memorylocation may store four bytes of data, where the position values areeach two bytes of data, and the memory counter is two bytes of data.

As shown, the position table 400 may be configured such that theposition values that are sequential in time are stored in sequentialmemory locations. For example, position values 8000, 8001, 8002, 8004,8005, and 8006 are sequential in time (as indicated by the correspondingmemory counters) and are stored at sequential memory locations 1-6,respectively. In this regard, a discontinuity in the memory counter mayindicate that the position values are not sequential even if theposition values are stored in neighboring memory locations. For example,although position value 8006 is stored in memory location 6 and positionvalue 8522 is stored at memory location 7, their respective memorycounters, 46 and 27, indicate that the two position values are notsequential.

The memory 260 may store information accessible by the one or moreprocessors or control circuit, including instructions that may beexecuted by the one or more processors. The memory 260 may also includedata that may be retrieved, manipulated or stored by the one or moreprocessors. The memory 260 may be of any non-transitory type capable ofstoring information accessible by the one or more processors, such as ahard-drive, memory card, ROM, RAM, DVD, CD-ROM, flash memory device,write-capable, and read-only memories.

The instructions may be any set of instructions to be executed directly,such as machine code, or indirectly, such as scripts, by the one or moreprocessors. In that regard, the terms “instructions,” “application,”“steps,” and “programs” may be used interchangeably herein. Theinstructions may be stored in object code format for direct processingby a processor, or in any other computing device language includingscripts or collections of independent source code modules that areinterpreted on demand or compiled in advance. Functions, methods, androutines of the instructions are explained in more detail below. Forexample, the instructions may include instructions for the motor drivecircuit 220, the control circuit 240, and/or the sensor circuit 250,such as those shown in FIGS. 6 and 7.

Data may be retrieved, stored or modified by the one or more processorsin accordance with the instructions. For instance, although the subjectmatter described herein is not limited by any particular data structure,the data may be stored in computer registers, a table having manydifferent fields and records, etc. The data may also be formatted in anycomputing device-readable format such as, but not limited to, binaryvalues, ASCII or Unicode. Moreover, the data may comprise anyinformation sufficient to identify the relevant information, such asnumbers, descriptive text, proprietary codes, pointers, references todata stored in other memories, or information that is used by a functionto calculate the relevant data. For example, the data may includesignals received from or sent to the motor drive circuit 220, thecontrol circuit 240, and/or the sensor circuit 250, such as those shownin FIGS. 3A-3B or the position information depicted via FIG. 4.

If the motor drive unit 200 experiences a critical event, such as a lossof power, the present position P_(PRES) determined by the controlcircuit 240 may become inaccurate. The inaccuracy in the presentposition P_(PRES) may result from the hysteresis operation used by thesensor circuit 250 to generate the states of the sensor signals V_(S1),V_(S2). For example, a first one of sensors of the sensor circuit 250(e.g., the first sensor 320) may drive the first sensor signal V_(S1)into the high state when the magnetic flux density B₁ of the magneticfield at the first sensor 320 rises above the high threshold TH_(HIGH)(e.g., as shown at 327 in FIG. 3B). The first sensor 320 may continue todrive the first sensor signal V_(S1) in the high state when the magneticflux density B₁ of the magnetic field at the first sensor 320 hasdropped into the region between the high threshold TH_(HIGH) and the lowthreshold TH_(LOW) (e.g., as shown at 328 in FIG. 3B). The first sensor320 may not drive the first sensor signal V_(S1) into the low stateuntil the magnetic flux density B₁ of the magnetic field at the firstsensor has dropped below the low threshold TH_(LOW). If the motor 210stops rotating before the magnetic flux density B₁ of the magnetic fieldat the first sensor 320 drops below the low threshold TH_(LOW), thefirst sensor 320 may maintain the magnitude of the first sensor signalV_(S1) in the high state (e.g., as shown at 329 in FIG. 3B).

When the power is reapplied to the motor drive unit 200 after a powerloss, the first sensor 320 may measure the magnetic flux density B₁ ofthe magnetic field to determine the state of the first sensor signalV_(S1). Upon receiving power, the first sensor 320 may be configured tocompare the magnetic flux density B₁ of the magnetic field to the highthreshold TH_(HIGH). If the motor drive unit 200 loses power when themagnitude of the magnetic flux density B₁ of the magnetic field isbetween the high threshold TH_(HIGH) and the low threshold TH_(LOW), thestate determined by the first sensor 320 may be different than the statedetermined before power was lost. For example, if the magnitude of themagnetic flux density B₁ of the magnetic field is between the highthreshold TH_(HIGH) and the low threshold TH_(LOW), the first sensor 320may determine that the state of the first sensor signal V_(S1) should below even though the magnitude of the magnetic flux density B₁ of themagnetic field never dropped below the low threshold TH_(LOW) beforepower was lost (e.g., since the magnetic flux density B₁ is less thanthe high threshold TH_(HIGH) when the first sensor 320 is repowered).

In addition, if the motor 110 is rotating when power is lost, theinaccuracy in the present position P_(PRES) may be worsened due topossible continued rotation of the motor 210 after the present positionPARES was last stored in the memory 260. The inconsistent generation ofthe states of the first sensor signals V_(S1), V_(S2) may cause thepresent position P_(PRES) of the shade fabric 112 as determined by thecontrol circuit 240 to drift over time.

Referring back to FIG. 2, the control circuit 240 may be configured todetect critical events, such as a power loss event. In this regard, thecontrol circuit 240 may be responsive to the magnitude of either thesupply voltage V_(CC) of the power supply 230 and/or the bus voltageV_(BUS) across the bus capacitor C_(BUS), such that, when the magnitudeof the bus voltage V_(BUS) and/or the supply voltage V_(CC) drops belowa low-voltage threshold, the control circuit 240 may determine and/ordetect that a power loss event is occurring or is about to occur. Forexample, the motor drive unit 200 may comprise a scaling circuit 290,such as one or more voltage dividers, for generating a scaled voltageV_(SCALED) that may indicate the magnitude of the bus voltage V_(BUS)and may be received by the control circuit 240, e.g., via ananalog-to-digital converter (ADC). The control circuit 240 may alsodirectly receive the supply voltage V_(CC) via the analog-to-digitalconverter (e.g., as shown as dashed arrow). Alternatively oradditionally, the motor drive circuit 220 may be configured to send aflag signal V_(FLAG) (e.g., as shown as dashed arrow) to the controlcircuit 240 when the magnitude of the bus voltage V_(BUS) drops belowthe low-voltage threshold.

The low-voltage threshold may be set as a percentage of the bus voltageV_(BUS) and/or supply voltage V_(CC) during normal operation such thatthe control circuit 240 may be able to make an early detection of thepower loss event but is not overly sensitive. Such early detection maybe advantageous since allow the control circuit 240 may initiate apower-down sequence to store useful data and/or to prevent damage. Forexample, the low-voltage threshold may be set at 80% of the bus voltageV_(BUS) and/or the input voltage V_(CC). In addition, since the busvoltage V_(BUS) may be larger in absolute value and may be noisy, avalue of the low-voltage threshold based on the magnitude of the busvoltage V_(BUS) may be set lower, down to 60% for example, of the busvoltage V_(BUS). Since the supply voltage V_(CC) is generated by theinternal power supply 230, a value of the low-voltage threshold based onthe magnitude of the supply voltage V_(CC) may need to be set within atighter range since that voltage is not expected to vary much from theoperational value or not as noisy. The control circuit 240 may use oneor both of the bus voltage V_(BUS) and the supply voltage V_(CC) fordetecting a power down condition. For example, if the magnitudes of boththe bus voltage V_(BUS) and the supply voltage V_(CC) are at or belowtheir respective thresholds, the control circuit 240 may determine apotential or actual power down event.

FIGS. 5A and 5B are pictorial diagrams 500A and 500B illustratingexample signals during a power loss event according to aspects of thedisclosure. Specifically, the diagrams 500A and 500B show examplesignals generated by the motor drive unit 200 (FIG. 2) that implementsthe sensor system 300 (FIGS. 3A and 3B) for controlling movements of theshade fabric 112 (FIG. 1), and stores the positions of the shade fabric112 in the position table 400 (FIG. 4). In this regard, in both FIGS. 5Aand 5B, graph 510 is a plot of the supply voltage V_(CC) of the motordrive unit 200 over time, graph 520 is a plot of the first sensor signalV_(S1) for the sensor 320 over time, and graph 530 is a plot of thesecond sensor signal V_(S2) for the sensor 330 over time. FIGS. 5A and5B differ in that, while FIG. 5A shows example signals where the motor210 is stopped (e.g., not rotating) when the power loss event occurs,FIG. 5B shows example signals where the motor is rotating when the powerloss event occurs.

Referring to FIG. 5A, initially at time t₀, the supply voltage V_(CC)has a normal magnitude V_(NOM). Since the motor is stopped, the sensorsignals 322, 332 generated by the respective sensors 320, 330 areconstant DC signals. At time t₁, the motor drive unit 200 may lose powerand the supply voltage V_(CC) may start to drop below the normalmagnitude V_(NOM). At time t₂, the supply voltage V_(CC) may drop belowthe low-voltage threshold V_(TH), and the control circuit 240 maydetermine that a power loss event is detected. Upon detecting the powerloss event, the control circuit 240 may be configured to initiate apower-down procedure. For example, the control circuit 240 may beconfigured to initiate the example power-down procedure shown in FIG. 6.

For instance, the control circuit 240 may be configured to storeadditional data to the memory 260 when a power loss event is detected.For instance, the control circuit 240 may be configured to store in thememory 260 the present position of the shade fabric 112 at time t₂ as apower-down position P_(d) when the power loss event is detected. Forexample, a present position of 8523 may be stored in the memory 260 asthe power-down position P_(d). Further, upon detecting the power lossevent at t₂, the control circuit 240 may also be configured to store tothe memory 260 the sensor states generated by the sensor circuit 250 attime t₂ as power-down sensor states S_(s1d), S_(s2d). For example asshown in FIG. 5A, present sensor states of 1 for sensor 320 and 0 forsensor 330 may be stored in the memory 260 as the power-down sensorstates S_(s1d), S_(s2d). To distinguish the power-down position P_(d)from the present position P_(PRES) stored during normal operation, thepower-down position P_(d), as well as the power-down sensor statesS_(s1d), S_(s2d), may be stored in specifically designated memorylocations of the memory 260 separate from the position table 400, storedlocally in the control circuit 240, or stored in the position table 400with specially-designated memory counter values (e.g., 0000). At timet₃, the magnitude of the supply voltage V_(CC) may drop to a level atwhich the control circuit 240 and the sensor circuit 250 may becomeunpowered. When the motor last stopped moving (e.g., prior to becomingunpowered at time t₃), the control circuit 240 may have stored a finalposition P_(f) in the position table 400.

At time t₄, the motor drive unit 200 may be powered once again after thepower loss event. When the motor drive unit 200 is powered up, thesensors 320, 330 of the sensor circuit 250 may begin to generate thesensor signals 322, 332 at time t₅. After time t₅, the control circuit240 may sample the sensor signals 322, 332, and determine power-upsensor states S_(s1u), S_(s2u) (e.g., present sensor states). However,because the power-up sensor states S_(s1u), S_(s2u) detected at power-upmay not match the power-down sensor states S_(s1d), S_(s2d) recordedduring the power loss event (e.g., even when there had not been anymovement during the power loss event), the control circuit 240 may needto make adjustments for certain inaccuracies. The control circuit 240may use the power-down sensor states S_(s1d), S_(s2d) detected atpower-up previously saved in the memory 260 and the power-up sensorstates S_(s1u), S_(s2u) to determine whether there is any inconsistencyin sensor states. Based on this determination, the control circuit 240may then determine a present position P_(u) at power-up using thepower-down position P_(d) previously saved in the memory 260.

In this regard, the control circuit 240 may be configured to compare thepower-up sensor states S_(s1u), S_(s2u) detected at time t₅ with thepower-down sensor states S_(s1d), S_(s2d) stored at time t₂. If, at timet₅, the control circuit 240 determines that the power-up sensor statesS_(s1u), S_(s2u) are not equal to the power-down sensor states S_(s1d),S_(s2d) stored at time t₂, the control circuit 240 may conclude that thepower-up sensor states S_(s1u), S_(s2u) are inaccurate, and thereforethe power-down position P_(d) previously saved in the memory 260 is alsoinaccurate. The control circuit may then determine the present positionP_(u) by adjusting the power-down position P_(d) with an adjustmentfactor.

For instance, if either the first power-down sensor state S_(s1d) is notequal to the first power-up sensor state S_(s1u) or the secondpower-down sensor state S_(s2d) is not equal to the second power-upsensor state S_(s2u), an adjustment factor may be determined based onthe difference in the power-down sensor states S_(s1d), S_(s2d) and thepower-up sensor states S_(s1u), S_(s2u). The present position P_(u) atpower-up may then be determined based on the power-down position P_(d)and the adjustment factor. For example, as shown in FIG. 5A, at time t₂,the control circuit 240 may store the power-down sensor states S_(s1d),S_(s2d) as 1 and 0, respectively and the power-down position P_(d) as8523, but may determine both of the power-up sensor states S_(s1u),S_(s2u) as 0. Based on the direction of rotation before power-down, thecontrol circuit 240 may determine that the power-up sensor statesS_(s1u), S_(s2u) are 1 sensor edge behind power-down sensor statesS_(s1d), S_(s2d), and set the adjustment factor as −1. The controlcircuit 240 may then adjust the power-down position P_(d) (e.g., 8523)by the adjustment factor (e.g., −1) to set the present position P_(u) atpower-up (e.g., 8523−1=8522).

If, however, both the first power-down sensor state S_(s1d) is not equalto the first power-up sensor state S_(s1u) and the second power-downsensor state S_(s2d) is not equal to the second power-up sensor stateS_(s2u), the control circuit 240 may not be able to reliably determinewhether the power-up sensor states S_(s1u), S_(s2u) are behind or aheadof the power-down sensor states S_(s1d), S_(s2d). In such cases, thecontrol circuit 240 may be configured to set the present position atpower-up P_(u) equal to the power-down position P_(d) stored in theposition table 400 in the memory 260. For example, suppose thepower-down sensor states S_(s1d), S_(s2d) are 1 and 0, respectively, butthe power-up sensor states S_(s1u), S_(s2u) are 0 and 1, respectively,the control circuit 240 may not be able to determine whether thediscrepancy is because the power-up sensor states S_(s1u), S_(s2u) are 2sensor edges behind power-down sensor states S_(s1d), S_(s2d), or 2sensor edges ahead of power-down sensor states S_(s1d), S_(s2d). In sucha case, the control circuit 240 may be further configured to log anerror.

Finally, if both of the power-up sensor states S_(s1u), S_(s2u) areequal to the power-down sensor states S_(s1d), S_(s2d), the controlcircuit 240 set the present position P_(u) at power-up equal to thepower-down position P_(d) stored in the position table 400 in the memory260. If the power-down sensor states S_(s1d), S_(s2d) stored at time t₂are 0 and 1, respectively, and the power-up sensor states S_(s1u),S_(s2u) are also 0 and 1, respectively, the control circuit 240 may setthe present position P_(u) at power-up equal to the power-down positionP_(d) (e.g., 8523) as stored in the position table 400 in the memory260.

FIG. 5B illustrates example signals if the motor 210 continued movingafter the power-down position P_(d) was recorded. When the motor 210 isrotating, the sensor 320, 330 generate the sensor signals 322, 332,which are used by the control circuit 240 to determine present positionsof the shade fabric 112. As shown, the first sensor signal 322 leads thesecond sensor signal 332 by 45 degrees, indicating that the motor 210 isrotating in a first direction (e.g., a counterclockwise direction tomove the shade fabric 112 upwards). At time t₁, the motor drive unit 200may lose power and the supply voltage V_(CC) may start to drop below thenormal magnitude of V_(NOM). At time t₂, the supply voltage V_(CC) maydrop below a low-voltage threshold V_(TH), and the control circuit 240may determine that a power loss event is detected. Upon detecting thepower loss event, the control circuit 240 may be configured to initiatea power-down procedure. For example, the control circuit 240 may beconfigured to initiate the example power-down procedure shown in FIG. 6.

After time t₂, the magnitude of the supply voltage V_(CC) may continueto drop while the motor 210 may continue to rotate and the sensors 320and 330 may continue to generate sensor signals 322, 332 in response tothe movement. The control circuit 240 may continue to update the presentposition of the shade fabric 112 in the position table 400 until timet₃, when the magnitude of the supply voltage V_(CC) may drop to a levelat which the control circuit 240 and the sensor circuit 250 may becomeunpowered. Prior to becoming unpowered at time t₃, the control circuit240 may have stored a final position P_(f) in the position table 400.

At time t₄, the motor drive unit 200 may be powered once again after thepower loss event. When the motor drive unit 200 is powered up, thesensors 320, 330 of the sensor circuit 250 may begin to generate thesensor signals 322, 332 at time t₅. After time t₅, the control circuit240 may sample the sensor signals 322, 332, and determine the power-upsensor states S_(s1u), S_(s2u). However, because the power-up sensorstates S_(s1u), S_(s2u) detected at power-up may not match thepower-down sensor states S_(s1d), S_(s2d) recorded during the power lossevent, the control circuit 240 may need to make adjustments for certaininaccuracies. In addition, the continued movement of the motor aftertime t₂ may introduce additional inaccuracies as to the actual presentposition of the shade fabric. The control circuit 240 may use the datapreviously saved in the memory 260 (e.g., the power-down sensor statesS_(s1d), S_(s2d), the power-down position P_(d), and final positionP_(f),) as well as the power-up sensor states S_(s1u), S_(s2u), todetermine whether the motor continued moving after time t₂, and whetherthere is any inconsistency in the sensor states. Based on thesedeterminations, the control circuit 240 may then determine a presentposition P_(u) at power-up.

In this regard, the control circuit 240 may be configured to look up thefinal position P_(f) in the position table 400, and compare the finalposition P_(f) with the power-down position P_(d). If the controlcircuit 240 determines that the final position P_(f) is equal to thepower-down position P_(d), the control circuit 240 may conclude that themotor 210 was stopped at time t₂. For example, referring to FIG. 4, ifthe final position P_(f) in the position table 400 is 8523 and thepower-down position P_(d) is also 8523, the control circuit 240 mayconclude that the motor 210 was stopped at time t₂. Further, based onthe determination that the motor 210 was stopped at time t₂, the controlcircuit 240 may be configured to predict that the final sensor statesS_(s1f), S_(s2f) at time t₃ are the same as the power-down sensor statesS_(s1d), S_(s2d).

If the control circuit 240 determines that the final position P_(f) isnot equal to the power-down position P_(d), the control circuit 240 mayconclude that the motor 210 continued to rotate after time t₂. Forexample, referring to FIG. 4, if the final position P_(f) stored inposition table 400 is 8541, but the power-down position P_(d) is 8523,the control circuit 240 may determine that the motor 210 continued torotate after the power-down position P_(f) was recorded at time t₂. Inthis case, the control circuit 240 may be configured to predict that thefinal sensor states S_(s1f), S_(s2f) by determining the differencebetween the power-down position P_(d) and the final position P_(f). Forexample, the control circuit 240 may determine that, since thepower-down position P_(d) was 8523, and the final position P_(f) was8540, the final position P_(f) is 18 increments from the power-downposition P_(d). Thus, the control circuit 240 may determine that a totalof 18 sensor edges were generated by the two sensors 320 and 330 betweentimes t₂ and t₃. The control circuit 240 may further look up thedirection of the rotation prior to the control circuit 240 and thesensor circuit 250 losing power at time t₃ (for example, stored in thememory 260). Using the direction of the rotation at power-down and the18 total sensor edges, the control circuit 240 may be configured toreproduce the sensor states between times t₂ and t₃, and predict thatthe final sensor states S_(s1f), S_(s2f) at time t₃ may be 1 and 0,respectively.

Thus, regardless of whether the motor 210 had was stopped or rotating attime t₂, the control circuit 240 may predict the final sensor statesS_(s1f), S_(s2f) at time t₃. The control circuit 240 may be configuredto compare the predicted final sensor states S_(s1f), S_(s2f) at time t₃with the power-up sensor states measured at time t₅ after power-up. If,as illustrated in FIG. 5B, the control circuit 240 determines that thepredicted final sensor states S_(s1f), S_(s2f) at time t₃ are not equalto the power-up sensor states S_(s1u), S_(s2u) (e.g., if either thefirst predicted final sensor state S_(s1f) is not equal to the firstpower-up sensor state S_(s1u) or the second predicted final sensor stateS_(s2f) is not equal to the second power-up sensor state S_(s2u)), thecontrol circuit 240 may determine the present position P_(u) at power-upbased on the final position P_(f) and an adjustment factor. For example,as illustrated in FIG. 5B, if the predicted final sensor states S_(s1f),S_(s2f) at time t₃ are 1 and 0, respectively, and the power-up sensorstates S_(s1u), S_(s2u) are both 1, the control circuit 240 maydetermine that the power-up sensor states S_(s1u), S_(s2u) are 1 sensoredge ahead of final sensor states S_(s1f), S_(s2f), and set theadjustment factor as +1. If the final position P_(f) stored in theposition table 400 is 8541, the control circuit 240 may set the presentposition P_(u) at power-up to be 8542 (e.g., 8541+1=8542).

If, however, both the first predicted final sensor state S_(s1f) is notequal to the first power-up sensor state S_(s1u) and the secondpredicted final sensor state S_(s2f) is not equal to the first power-upsensor state S_(s2u), the control circuit 240 may not be able todetermine whether the power-sup sensor states S_(s1u), S_(s2u) arebehind or ahead of the final sensor states S_(s1f), S_(s2f). In suchcases, the control circuit 240 may be configured to set the presentposition at power-up as the final position P_(f) stored in the positiontable 400 in the memory 260. For example, if the final sensor statesS_(s1f), S_(s2f) are equal to 1 and 0, respectively, but the power-upsensor states S_(s1u), S_(s2u) are equal to 0 and 1, respectively, thecontrol circuit 240 may not be able to determine whether the discrepancyis because the power-up sensor states S_(s1u), S_(s2u) are 2 incrementsbehind final sensor states S_(s1f), S_(s2f), or 2 increments ahead offinal sensor states S_(s1f), S_(s2f). The control circuit 240 may befurther configured to log an error.

If the predicted final sensor states S_(s1f), S_(s2f) are equal to thepower-up sensor states S_(s1u), S_(s2u), the control circuit 240 may setthe present position P_(u) at power-up equal to the final position P_(f)stored in the position 400 in the memory 260. Thus, for the exampleabove where the motor 210 continued to rotate 18 edges between times t₂and t₃, if the predicted final sensor states S_(s1f), S_(s2f) are 1 and0, respectively, and the power-up sensor states S_(s1u), S_(s2u) arealso 1 and 0, respectively, the control circuit 240 may set the presentposition P_(u) at power-up equal to the final position P_(f) (e.g.,8540) stored in the position table 400 in the memory 260.

Although the foregoing description above with respective to FIGS. 5A and5B involve two sensors, the control circuit 240 may be configured tomake analogous determinations when the sensor system 300 includes morethan two sensors. In this regard, the control circuit 240 may beconfigured to make analogous determinations using more than twopower-down sensor states (e.g., S_(s1d), S_(s2d), . . . , S_(snd)), thepower-down position P_(d), the final position P_(f), and the power-upsensor states (e.g., S_(s1u), S_(s2u), . . . , S_(snu)). One notabledifference is that, even if two present sensor states at power-up aredifferent from their corresponding predicted final sensor states, it maystill be possible to determine adjustment factors, so long as not all ofthe power-down sensor states (S_(s1d), S_(s2d), . . . , S_(snd)) aredifferent from the corresponding power-up sensor states (S_(s1u),S_(s2u), . . . , S_(snu)). On the other hand, the control circuit 240may also be configured to make analogous determinations when the sensorsystem 300 includes only one sensor, however, the control circuit 240may require additional information to determine the direction of theadjustment factor (e.g., from the direction signal V_(DIR) of thecontrol circuit 240 or the PWM signal of the motor drive circuit 220).

Referring back to FIG. 2, the motor drive unit 200 may further include acommunication circuit 270 that allows the control circuit 240 totransmit and receive communication signals, such as wired communicationsignals and/or wireless communication signals, such as radio-frequency(RF) signals. For example, the communication circuit 270 may beconfigured to provide the communication link 150 shown in FIG. 1.

The motor drive unit 200 may further include a user interface 280 forallowing a user to provide inputs to the control circuit 240. The usermay use the user interface 280 during set up and configuration, and/orduring normal operation (e.g., while the motor drive unit 200 isrunning). The user may send a command using the user interface 280 tothe control circuit 240 via the communication circuit 270, and thecontrol circuit 240 may control the motor drive circuit 220, whichcontrols the movement of the motor 210. For example, the user interface280 may be configured as the user interface 160 shown in FIG. 1.

While only one motor 210, motor drive circuit 220, power supply 230,control circuit 240, memory 250, sensor circuit 260, communicationcircuit 270, and user interface 280 are shown in the motor drive unit200, alternatively any number of motors, motor drive circuits, powersupplies, control circuits, memories, sensor circuits, communicationcircuits, and user interfaces may be included in the motor drive unit200.

Further to example systems described above, example methods are nowdescribed. Such methods may be performed using the systems describedabove, modifications thereof, or any of a variety of systems havingdifferent configurations. It should be understood that the operationsinvolved in the following methods need not be performed in the preciseorder described. Rather, various operations may be handled in adifferent order or simultaneously, and operations may be added oromitted.

FIG. 6 is a flowchart of an example power-down procedure 600 that may beexecuted upon detection of a power loss event. For example, thepower-down procedure 600 may be executed by a control circuit of a motordrive unit (e.g., the control circuit 240 of the motor drive unit 200 ofFIG. 2) that implements a sensor system (e.g., the sensor system 300 ofFIGS. 3A and 3B) for controlling movements of a covering material (e.g.,the shade fabric 112), and stores the positions of the covering materialin a position table (e.g., the position table 400 of FIG. 4). At 610, alow-voltage condition may be detected. For example, the low-voltagecondition may be detected when the magnitude of a supply voltage and/ora bus voltage drops below a predetermined low-voltage threshold V_(TH),as described in detail above with respect to the example systems. Forexample, the low-voltage threshold V_(TH) may be a fixed value or apercentage of the supply voltage and/or the bus voltage during normaloperation, as described in detail above with respect to the examplesystems.

At 620, a present position may be stored in a memory as a power-downposition upon detection of the low-voltage condition. For instance,referring back to FIGS. 5A and 5B, the control circuit 240 may store inthe memory 260 the present position of the shade fabric 112 at time t₂as the power-down position P_(d). At 630, one or more present sensorstates may be stored in the memory as one or more power-down sensorstates. For example, referring back to FIGS. 5A and 5B, the controlcircuit 240 may store to the memory 260 the sensor states generated bythe sensor circuit 250 at time t₂ as the power-down sensor statesS_(s1d), S_(s2d).

After detection of the power loss event (e.g., the low-voltagecondition), one or more positions may be continued to be stored in thememory at 640. For example, referring back to FIG. 5B, if the motor isrotating, the control circuit 240 may continue to update the presentposition of the shade fabric 112 in the memory 260 until time t₃, whenthe control circuit may become unpowered. Prior to time t₃, a finalposition P_(f) may have been stored in the memory (e.g., by a differentsoftware procedure than the power-down procedure 600).

FIG. 7 is a flowchart of an example power-up procedure 700, for example,that may be executed as part of a startup routine. For example, thepower-up procedure 700 may be executed by a control circuit of a motordrive unit (e.g., the control circuit 240 of the motor drive unit 200 ofFIG. 2) that implements a sensor system (e.g., the sensor system 300 ofFIGS. 3A and 3B) for controlling movements of a covering material (e.g.,the shade fabric 112), and stores the positions of the covering materialin a position table (e.g., the position table 400 of FIG. 4). At 710,the motor drive unit may be powered up and the control circuit mayexecute the power-up procedure 700. For example, when the motor driveunit 200 is powered up again after a power loss event, the controlcircuit 240 may once again receive sensor signals from sensors 320, 330,and determine power-ups sensor state, such as the power-up sensor statesS_(s1u), S_(s2u). However, because of the power loss event, the controlcircuit may need to adjust for certain inaccuracies, and may do so aspart of the power-up procedure 700.

At 720, the power-down position and the one or more power-down sensorstates may be recalled from the memory. For example, referring back toFIG. 5A, these may be the power-down position P_(d) and the power-downsensor states S_(s1d), S_(s2d) that the control circuit 240 stored inthe memory 260 at time t₂. At 730, one or more present sensor states maybe determined. The one or more power-up sensor states are compared withthe power-down sensor states to determine whether further adjustmentsare needed. At 740, a determination may be made as to whether thepower-up sensor state is different from the power-down sensor state forone or more sensors or not.

If the power-up sensor state is different from the power-down sensorstate for one or more sensors, a determination may be made as to whetherthe present sensor state is different from the power-down sensor statefor all the sensors or not at 750. If that is not the case, anadjustment factor may be determined at 760. For example, the adjustmentfactor may be determined based on the power-down sensor state and thepower-up sensor state for the one or more sensors, as described indetail above with respect to the example systems. For example, referringback to FIG. 5A, based on the difference between the power-down sensorstates S_(s1d), S_(s2d) and the power-up sensor states S_(s1u), S_(s2u),the control circuit 240 may determine that the power-up sensor statesS_(s1u), S_(s2u) are 1 sensor edge behind power-down sensor statesS_(s1d), S_(s2d), and set the adjustment factor as −1. At 770, a presentposition may be set based on the power-down position and the adjustmentfactor. For instance, continuing from the previous example, if thepower-down position P_(d) stored in the position table 400 was 8541, thecontrol circuit 240 may set the present position at power-up P_(u) to be8540 (e.g., 8541−1).

If it is determined at 750 that the power-down sensor state is differentfrom the present sensor state for all the sensors, an error may belogged at 780 (e.g., since the control circuit may be able to determinewhether power-up present sensor states are behind or ahead of thepower-down sensor states). Thus, the present position may be set as thepower-down position at 790. If it is determined at 740 that thepower-down sensor state is not different from the power-up sensor statefor any of the sensors, the present position may be set as thepower-down position at 790. In such cases, because all the power-downsensor states are equal to the power-up sensor states, it may beconcluded that the power-down position was determined based onaccurately detected power-down sensor states.

FIG. 8 is a flowchart of an example power-up procedure 800, for example,that may be executed as part of a startup routine. For example, thepower-up procedure 800 may be executed by a control circuit of a motordrive unit (e.g., the control circuit 240 of the motor drive unit 200 ofFIG. 2) that implements a sensor system (e.g., the sensor system 300 ofFIGS. 3A and 3B) for controlling movements of a covering material (e.g.,the shade fabric 112), and stores the positions of the covering materialin a position table (e.g., the position table 400 of FIG. 4). At 810,the motor drive unit may be powered up and the control circuit mayexecute the power-up procedure 700. For instance, when the motor driveunit 200 is powered up again after a power loss event, the controlcircuit 240 may once again receive sensor signals from sensors 320, 330,such as power-up sensor states S_(s1u), S_(s2u). However, because of thepower loss event, the control circuit may need to adjust for certaininaccuracies, and may do so by as part of the power-up procedure 800.

At 820, the power-down position and the one or more power-down sensorstates may be recalled from the memory. For instance, referring back toFIG. 5B, these may be the power-down position P_(d) and the power-downsensor states S_(s1d), S_(s2d) that the control circuit 240 stored inthe memory 260 (e.g., at time t₂ of FIGS. 5A and 5B). At 830, a finalposition may be determined from the memory. For instance, as describedin detail above with respect to the example systems, the control circuit240 may look up the final position P_(f) recorded in position table 400.

At 840, a determination may be made as to whether the motor was stoppedor rotating during the power loss event (e.g., after the power-downposition was stored). For example, whether the motor was running may bedetermined based on whether the final position is equal to thepower-down position, as described in detail above with respect to theexample systems. For example, referring back to FIG. 5B, if the controlcircuit 240 determines that the final position P_(f) is equal to thepower-down position P_(d), the control circuit 240 may conclude that themotor 210 was not moving at time t₂. Otherwise, the control circuit mayconclude that the motor 210 was rotating after time t₂.

If the control circuit determines that the motor was stopped before thepower loss event (e.g., and did not rotate after the power-down positionwas stored), one or more predicated final sensor states may be set to bethe power-down sensor states at 842. For instance, referring back toFIG. 5B, based on the determination that the motor 210 was stopped(e.g., at time t₂ of FIG. 5A), the control circuit 240 may predict thatthe final sensor states S_(s1f), S_(s2f) are the same as the power downsensor states S_(s1d), S_(s2d).

If the control circuit determines that the motor was rotating during thepower loss event (e.g., after the power-down position was stored), oneor more predicted final sensor states may be computed as described indetail above with respect to the example systems at 844. For example,the one or more predicted final sensor states may be computed based on anumber of sensor edges between the power-down position P_(d) and thefinal position P_(f), and a direction of rotation before the power lossevent.

With the predicted final sensor states set or computed, one or morepresent sensor states may be determined at 850. The one or more presentsensor states may be compared with the predicted final sensor states todetermine whether further adjustments are needed. Thus, a determinationis made as to whether the present sensor state is different from thepredicted final sensor state for one or more sensors or not at 860.

If the present sensor state is different from the predicted final sensorstate for one or more sensors, the control circuit may further determinewhether the predicted final sensor state is different from the presentsensor state for all the sensors at 862. If that is not the case, anadjustment factor is determined at 870. For example, the adjustmentfactor may be determined based on the predicted final sensor state andthe present sensor state for the one or more sensors, as described indetail above with respect to the example systems. For instance,referring back to FIG. 5B, based on the generated sensor states betweent₂ and t₃, the control circuit 240 may determine that the power-upsensor states S_(s1u), S_(s2u) are 1 sensor edge ahead of final sensorstates S_(s1f), S_(s2f), and set the adjustment factor as +1. At 872, apresent position is set based on the final position and the adjustmentfactor. For example, continuing from the previous example, if the finalposition P_(f) stored in the position table 400 was 8541, the controlcircuit may set the present position at power-up P_(u) to be 8542 (e.g.,8541+1).

If the control circuit determines that the predicted final sensor stateis different from the present sensor state for all the sensors, an errormay be logged at 880. This is because in such cases, it may not bepossible to determine whether the present sensor states at power-up arebehind or ahead of the final sensor states. At 890, a present positionmay be set as the final position.

On the other hand, if the control circuit determines at 860 that thepredicted final sensor state is not different from the present sensorstate for any of the sensors, a present position may be set as the finalposition at 890. In such cases, because the predicted final sensorstates are equal to the present sensor states at power-up, it may beconcluded that the motor was stopped during the power loss event (e.g.,after the final position was recorded) and the final position wasdetermined based on accurately detected sensor states.

Unless otherwise stated, the foregoing alternative examples are notmutually exclusive, but may be implemented in various combinations toachieve unique advantages. As these and other variations andcombinations of the features discussed above may be utilized withoutdeparting from the subject matter defined by the claims, the foregoingdescription of the embodiments should be taken by way of illustrationrather than by way of limitation of the subject matter defined by theclaims. In addition, the provision of the examples described herein, aswell as clauses phrased as “such as,” “including” and the like, shouldnot be interpreted as limiting the subject matter of the claims to thespecific examples; rather, the examples are intended to illustrate onlyone of many possible embodiments. Further, the same reference numbers indifferent drawings may identify the same or similar elements.

1. A motorized window treatment system comprising: a covering material;a motor drive circuit configured to generate signals that cause a motorto change a position of the covering material; a sensor circuitconfigured to generate two sensor signals indicative of the position ofthe covering material; and a control circuit powered from a supplyvoltage, the control circuit coupled to the motor drive circuit and thesensor circuit, the control circuit configured to: determine, atpower-up, a present sensor state for each of two sensor signals;determine a predicted sensor state for each of the sensor signals;compare the predicted sensor state with the present sensor state foreach of the sensor signals; and determine the present position of thecovering material based on the comparison of the predicted sensor stateand the present sensor state of each of the sensor signals.
 2. Themotorized window treatment system of claim 1, wherein, prior todetermining, at power-up, the present sensor state for each of thesensors, the control circuit is configured to: detect a power-down eventbased on a voltage falling below a predetermined threshold low voltage;store the present position as a power-down position based on detectionof the power-down event; and store a sensor state as a power-down statefor each of the sensors based on detection of the power-down event. 3.The motorized window treatment system of claim 2, wherein the controlcircuit is configured to determine a final position of the coveringmaterial prior to an end of the power-down event.
 4. The motorizedwindow treatment system of claim 3, wherein the control circuit isconfigured to determine the present position of the covering material bysetting the present position of the covering material equal to the finalposition, and adjusting the present position of the covering material byan adjustment factor if the predicted sensor state is not the same asthe present sensor state for only one of the sensors.
 5. The motorizedwindow treatment system of claim 4, further wherein the control circuitis configured to determine the adjustment factor based on a differencebetween the final position of the covering material and the power-downposition, and a difference between the predicted sensor state and thepresent sensor state for each of the sensors.
 6. The motorized windowtreatment system of claim 4, wherein the control circuit is configuredto adjust the present position of the covering material by theadjustment factor by incrementing or decrementing the present positionof the covering material depending upon a direction of rotation of themotor prior to the power-down event.
 7. The motorized window treatmentsystem of claim 3, wherein the control circuit is configured todetermine the present position of the covering material by setting thepresent position of the covering material equal to the final position ifthe predicted sensor state is the same as the present sensor state foreach of the sensors.
 8. The motorized window treatment system of claim3, wherein the control circuit is configured to determine a predictedsensor state for each of the sensors by setting the predicted sensorstate equal to the power-down state for each of the sensors based if thefinal position of the covering material is equal to the power-downposition.
 9. The motorized window treatment system of claim 3, whereinthe control circuit is configured to determine a predicted sensor statefor each of the sensors by determining the predicted sensor state basedon the power-down state and a difference between the final position ofthe covering material and the power-down position.
 10. The motorizedwindow treatment system of claim 1, wherein the control circuit isconfigured to store an error condition in memory if the predicted sensorstate is not the same as the present sensor state for each of the twosensors.
 11. A method of adjusting a present position of a coveringmaterial of a motorized window treatment, the method comprising:determining, at power-up, a present sensor state for each of twosensors; determining a predicted sensor state for each of the sensors;comparing the predicted sensor state with the present sensor state foreach of the sensors; and determining the present position of thecovering material based on the comparison of the predicted sensor stateand the present sensor state of each of the sensors.
 12. The method ofclaim 11, further comprising, prior to determining, at power-up, thepresent sensor state for each of the sensors: detecting a power-downevent based on a voltage falling below a predetermined threshold lowvoltage; storing the present position as a power-down position based ondetection of the power-down event; and storing a sensor state as apower-down state for each of the sensors based on detection of thepower-down event.
 13. The method of claim 12, further comprising:determining a final position of the covering material prior to an end ofthe power-down event.
 14. The method of claim 13, wherein determiningthe present position of the covering material further comprises: settingthe present position of the covering material equal to the finalposition; and adjusting the present position of the covering material byan adjustment factor if the predicted sensor state is not the same asthe present sensor state for only one of the two sensors.
 15. The methodof claim 14, further comprising: determining the adjustment factor basedon a difference between the final position of the covering material andthe power-down position, and a difference between the predicted sensorstate and the present sensor state for each of the sensors.
 16. Themethod of claim 14, wherein adjusting the present position of thecovering material by the adjustment factor further comprisesincrementing or decrementing the present position of the coveringmaterial depending upon a direction of rotation of the motor prior tothe power-down event.
 17. The method of claim 13, wherein determiningthe present position of the covering material further comprises settingthe present position of the covering material equal to the finalposition if the predicted sensor state is the same as the present sensorstate for each of the sensors.
 18. The method of claim 13, whereindetermining a predicted sensor state for each of the sensors furthercomprises setting the predicted sensor state equal to the power-downstate for each of the sensors based if the final position of thecovering material is equal to the power-down position.
 19. The method ofclaim 13, wherein determining a predicted sensor state for each of thesensors further comprises determining the predicted sensor state basedon the power-down state and a difference between the final position ofthe covering material and the power-down position.
 20. The method ofclaim 11, further comprising: storing an error condition in memory ifthe predicted sensor state is not the same as the present sensor statefor each of the two sensors.